unit GUIDUtilsTests;

interface

uses
  TestFrameWork,
  GUIDUtils;

type

  TGUIDUtilsTests = class(TTestCase)
  published
    procedure testGUIDUtils;
  end;

implementation

uses SysUtils, Classes;

{ TGUIDUtilsTests }

procedure TGUIDUtilsTests.testGUIDUtils;
var
  i: Integer;
  G: TGUID;
  CN: TComponentName;
begin
  for i := 0 to 20 do
  begin
    CreateGUID(G);
    CN := GUIDToComponentName(G);
    Check(IsValidIdent(CN));
    CheckEquals(GuidToString(G), GuidToString(ComponentNameToGUID(CN)));

    CreateGUID(G);
    CN := GUIDToComponentName(G);
    Check(IsValidIdent(CN));
    CheckEquals(GuidToString(G), GuidToString(ComponentNameToGUID(CN)));

    CreateGUID(G);
    CN := GUIDToComponentName(G);
    Check(IsValidIdent(CN));
    CheckEquals(GuidToString(G), GuidToString(ComponentNameToGUID(CN)));
  end;
end;

initialization

  TestFramework.RegisterTest('GUIDUtilsTests Suite',
    TGUIDUtilsTests.Suite);

end.
